<!DOCTYPE html>
<html>
<head>
	<title>{$name} {$seo_title} {$site_name}</title>
	<meta name="keywords" content="{$seo_keywords}" />
	<meta name="description" content="{$seo_description}">
    <tc_include file="Public:head" />
</head>
<body>
<tc_include file="Public:nav" />
<div class="container tc-main">
    <h2>{$name}</h2>
    <div class="row">
		<div class="span9">
			<div class="">
				<php>
					$lists = sp_sql_posts_paged("cid:$cat_id;order:post_date DESC;",10);
				</php>
				<volist name="lists['posts']" id="vo">
				<php>
					$smeta=json_decode($vo['smeta'], true);
				</php>
				
				<div class="list-boxes">
					<h2><a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">{$vo.post_title}</a></h2>
					<p>{$vo.post_excerpt|msubstr=0,256}</p>
					<div>
						<div class="pull-left">
							<div class="list-actions">
							<a href="javascript:;"><i class="fa fa-eye"></i><span>{$vo.post_hits}</span></a>
							<a href="{:U('article/do_like',array('id'=>$vo['object_id']))}" class="js-count-btn"><i class="fa fa-thumbs-up"></i><span class="count">{$vo.post_like}</span></a>
							<a href="{:U('user/favorite/do_favorite',array('id'=>$vo['object_id']))}" class="js-favorite-btn" data-title="{$vo.post_title}" data-url="{:U('portal/article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}" data-key="{:sp_get_favorite_key('posts',$vo['object_id'])}">
								<i class="fa fa-star-o"></i>
							</a>
							</div>
						</div>
						<a class="btn btn-warning pull-right" href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">查看更多</a>
					</div>
				</div>
				</volist>
				
			</div>
			<div class="pagination"><ul>{$lists['page']}</ul></div>
		</div>
		<div class="span3">
			<div class="tc-box first-box">
			<div class="headtitle">
          		<h2>分享</h2>
          	</div>
			<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tqf" data-cmd="tqf" title="分享到腾讯朋友"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_youdao" data-cmd="youdao" title="分享到有道云笔记"></a></div>
			<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"32"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=86835285.js?cdnversion='+~(-new Date()/36e5)];</script>          
        	</div>
        	
        	<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>热门文章</h2>
	        	</div>
	        	<div class="ranking">
	        		<php>
						$hot_articles=sp_sql_posts("cid:$portal_hot_articles;field:post_title,post_excerpt,object_id,term_id,smeta;order:post_hits desc;limit:5;"); 
					</php>
		        	<ul class="unstyled">
		        		<foreach name="hot_articles" item="vo">
		        			<php>$top=$key<3?"top3":"";</php>
							<li class="{$top}"><i>{$key+1}</i><a title="{$vo.post_title}" href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">{$vo.post_title}</a></li>
						</foreach>
					</ul>
				</div>
			</div>
			<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>最新评论</h2>
	        	</div>
	        	<div class="comment-ranking">
	        		<php>$last_comments=sp_get_comments("field:*;limit:0,5;order:createtime desc;");</php>
	        		<foreach name="last_comments" item="vo">
	                    <div class="comment-ranking-inner">
	                        <i class="fa fa-comment"></i>
	                        <a href="{:U('user/index/index',array('id'=>$vo['uid']))}">{$vo.full_name}:</a>
	                        <span>{$vo.content}</span>
	                        <a href="__ROOT__/{$vo.url}#comment{$vo.id}">查看原文</a>
	                        <span class="comment-time">{:date('m月d日  H:i',strtotime($vo['createtime']))}</span>
	                    </div>
                    </foreach>
                </div>
			</div>
			
			<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>最新加入</h2>
	        	</div>
	        	<php>
	        	$last_users=sp_get_users("field:*;limit:0,8;order:create_time desc;");
	        	</php>
	        	<ul class="list-unstyled tc-photos margin-bottom-30">
	        		<foreach name="last_users" item="vo">
                    <li>
	                    <a href="{:U('user/index/index',array('id'=>$vo['id']))}">
	                    <img alt="" src="{:U('user/public/avatar',array('id'=>$vo['id']))}">
	                    </a>
                    </li>
                    </foreach>
                </ul>
			</div>
			
			<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>最新发布</h2>
	        	</div>
	        	<php>
					$last_post=sp_sql_posts("cid:$portal_last_post;field:post_title,post_excerpt,object_id,term_id,smeta;order:listorder asc;limit:4;"); 
				</php>
	        	<div class="posts">
	        		<foreach name="last_post" item="vo">
	        		<php>$smeta=json_decode($vo['smeta'],true);</php>
			        	<dl class="dl-horizontal">
				            <dt>
					            <a class="img-wraper" href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">
					            	<if condition="empty($smeta['thumb'])"> 
										<img src="__TMPL__Public/assets/images/default_tupian4.png" class="img-responsive" alt="{$vo.post_title}"/>
									<else /> 
										<img src="{:sp_get_asset_upload_path($smeta['thumb'])}" class="img-responsive img-thumbnail" alt="{$vo.post_title}" />
									</if>
					            </a>
				            </dt>
				            <dd><a href="{:leuu('article/index',array('id'=>$vo['object_id'],'cid'=>$vo['term_id']))}">{:msubstr($vo['post_excerpt'],0,32)}</a></dd>
				        </dl>
			        </foreach>
		        </div>
			</div>
			
			<php>$ad=sp_getad("portal_list_right_aside");</php>
			<if condition="!empty($ad)">
        	<div class="tc-box">
	        	<div class="headtitle">
	        		<h2>赞助商</h2>
	        	</div>
	        	<div>
		        	{$ad}
		        </div>
			</div>
			</if>
		</div>
    </div>
    
    
    <tc_include file="Public:footer" />
</div>

    
<!-- JavaScript -->
<tc_include file="Public:scripts" />
</body>
</html>